<template>
  <div class="app-container">
    <el-row>
      <el-col :span="12" :offset="6">
        <el-card>
          <el-form ref="form" :model="form" label-width="80px">
            <el-row>
              <el-col :span="12">
                <el-form-item label="认证信息">
                  <el-select v-model="value">
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item
                  ><el-input
                    style="margin-left: -60px"
                    v-model="form.authInfoStr"
                  ></el-input
                ></el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="详细信息"
              ><el-input
                v-model="form.authDetail"
                type="textarea"
                :rows="6"
                placeholder="请输入详细信息"
              ></el-input
            ></el-form-item>
            <el-button type="primary" @click="submitForm">提交认证</el-button>
          </el-form>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { infoAuth } from "@/api/system/user";

export default {
  name: "Authentication",
  data() {
    return {
      form: {},
      options: [
        {
          value: "身份证",
          label: "身份证",
        },
        {
          value: "学生证",
          label: "学生证",
        },
        {
          value: "住址信息",
          label: "住址信息",
        },
      ],
      value: "",
    };
  },
  methods: {
    submitForm() {
      this.form.authInfo = this.value + this.form.authInfoStr;
      infoAuth(this.form).then((response) => {
        if (response.code === 200) {
          this.msgSuccess("提交成功");
        }
      });
    },
  },
};
</script>
